<template>
    <div class="famous">
        <div class="famous-title">
            <h2>名师榜</h2>
        </div>
        <view class="section">
            <scroll-view class="scroll-view_H"  scroll-x="true" bindscroll="scroll">
                <view class="section_gap" v-for="(item,index) in teachList" :key="index">
                    <div class="teach-inner">
                        <div class="teach-pic">
                            <image :src="item.head"></image>
                        </div>
                        <dl>
                            <dt>
                                <h3>{{ item.name }}</h3>
                            </dt>
                            <dd>
                                <span>{{ item.count_subscribe }}人订阅</span>
                            </dd>
                        </dl>
                    </div>
                </view>
            </scroll-view>
        </view>
        <div class="famous-slide">
            <div class="pg-block">
                <span class="pg-red" :style="{left: pageLeft + '%'}"></span>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    props: ['teachList'],
    data() {
        return {
            pageLeft: 4,
            scroleft: 100
        }
    },
    methods: {
        scroll() {
            console.log('2323')
        }
    },
    mounted() {
        this.teachList.map(item => {
            if(item.count_subscribe >= 10000) {
                item.count_subscribe = Math.floor(item.count_subscribe / 10000) + '万'
            }
        })
    },
    computed: {
        
    }
}
</script>

<style>
.famous .famous-title h2 {
    font-size:0.42rem;
    font-family:PingFangSC-Semibold;
    font-weight:600;
    color:rgba(51,51,51,1);
    line-height:0.48rem;
}
.famous .section {
    height: 3.6rem;
}
.famous .section .scroll-view_H {
    height: 3.6rem;
    white-space: nowrap;
    display: flex;
    margin-top: 0.24rem;
}
.famous .section .scroll-view_H .section_gap {
    display: inline-block;
    background:rgba(255,255,255,1);
    border-radius:4px;
    border:1px solid rgba(231,233,236,1);
    margin-right: 0.2rem;
    box-sizing: border-box;
    height: 3.54rem;
}
.famous .section .scroll-view_H .section_gap .teach-pic {
    width: 1.6rem;
    height: 1.6rem;
    margin: 0 auto;
}
.famous .section .scroll-view_H .section_gap .teach-pic image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
.famous .section .scroll-view_H .section_gap .teach-inner {
    /* padding: 0.36rem; */
    width: 1.6rem;
    padding: 0.36rem 0.36rem 0.36rem 0.36rem;
}
.famous .section .scroll-view_H .section_gap dl {
    text-align: center;
}
.famous .section .scroll-view_H .section_gap dl dt {
    margin-top: 0.24rem;
}
.famous .section .scroll-view_H .section_gap dl dt h3 {
    font-size: 0.32rem;
    font-family:PingFangSC-Medium;
    font-weight:500;
    color:rgba(51,51,51,1);
    line-height: 0.45rem;
}
.famous .section .scroll-view_H .section_gap dl dd span {
    font-size: 0.24rem;
    font-family:PingFangSC-Regular;
    font-weight:400;
    color:rgba(120,120,120,1);
    line-height: 0.33rem;
}
.famous .famous-slide {
    margin-top: 0.24rem;
    height: 6px;
}
.famous .famous-slide .pg-block {
    width: 100%;
    height: 2px;
    background:rgba(247,248,250,1);
    border-radius:4px;
    position: relative;
}
.famous .famous-slide .pg-block .pg-red {
    width:60px;
    height:4px;
    background:rgba(255,60,84,1);
    box-shadow:0px 2px 2px 0px rgba(255,60,84,0.4);
    border-radius:4px;
    position: absolute;
}
</style>
